package com.chatplus.application.domain.entity.orders;

import com.baomidou.mybatisplus.annotation.*;
import com.chatplus.application.datasource.handler.JacksonJsonTypeHandler;
import com.chatplus.application.datasource.id.IdEntity;
import com.chatplus.application.domain.dto.OrderRemarkDto;
import com.chatplus.application.enumeration.OrderStatusEnum;
import org.apache.ibatis.type.Alias;

import java.math.BigDecimal;
import java.time.Instant;

/**
 * <p>Table: t_order - 充值订单表</p>
 *
 * @author developer
 */
@Alias("order")
@TableName(value = "t_order", autoResultMap = true)
public class OrderEntity extends IdEntity {

    /**
     * 用户ID
     */
    private Long userId;
    /**
     * 产品ID
     */
    private Long productId;
    /**
     * 用户手机号
     */
    private String mobile;
    /**
     * 订单ID (该字段作废)
     */
    @Deprecated
    private String orderNo;
    /**
     * 订单产品
     */
    private String subject;
    /**
     * 订单金额
     */
    private BigDecimal amount;
    /**
     * 订单状态（0：待支付，1：已扫码，2：支付失败）
     */
    private OrderStatusEnum status;
    /**
     * 备注
     */
    @TableField(typeHandler = JacksonJsonTypeHandler.class)
    private OrderRemarkDto remark;
    /**
     * 支付时间
     */
    private Instant payTime;
    /**
     * 支付方式
     */
    private String payWay;

    public Long getUserId() {
        return this.userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getProductId() {
        return this.productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getMobile() {
        return this.mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getOrderNo() {
        return this.orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getSubject() {
        return this.subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public BigDecimal getAmount() {
        return this.amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public OrderStatusEnum getStatus() {
        return this.status;
    }

    public void setStatus(OrderStatusEnum status) {
        this.status = status;
    }

    public OrderRemarkDto getRemark() {
        return this.remark;
    }

    public void setRemark(OrderRemarkDto remark) {
        this.remark = remark;
    }

    public Instant getPayTime() {
        return this.payTime;
    }

    public void setPayTime(Instant payTime) {
        this.payTime = payTime;
    }

    public String getPayWay() {
        return this.payWay;
    }

    public void setPayWay(String payWay) {
        this.payWay = payWay;
    }

}
